<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div class="topbar">
	<table>
		<tr>
			<td class="logo"><img alt="logo" src="resources/images/Logo.jpg" /></td>
			<td class="desc"><p>TOP Pitch is a highly focused, data
					driven and interactive recruiting platform that connects high
					potential MBA students to hedge funds</p>
				<span>BETA</span> <c:if test="${ nytItemsExists }">
					<div id="nytlinksbox" class="nytlinksbox">
						<div id="nytlinks" class="nytlinks">
							<ul>
								<c:forEach var="nitem" items="${ nytItems }">
									<li><a href="${ nitem.link }" target="_blank">${ nitem.title }</a></li>
								</c:forEach>
							</ul>
						</div>
					</div>
				</c:if></td>
		</tr>
		<c:if test="${ nytItemsExists }">
			<script type="text/javascript">
				$(document).ready(
						function() {
							var speed = 2000;
							var block = '#nytlinks li';
							var eq = 4;
							var h = 0;
							if ($(block).length > eq) {
								$(block).slice(eq).css('display', 'none');
								h = setInterval('scrollContent("' + block
										+ '",' + eq + ',2)', speed);
								$('#nytlinksbox')
										.mouseout(
												function() {
													h = setInterval(
															'scrollContent("'
																	+ block
																	+ '",' + eq
																	+ ',2)',
															speed);
												});
								$('#nytlinksbox').mouseover(function() {
									clearInterval(h);
								});
							}
						});
				function scrollContent(block, eq, type) {
					var firstNode = $(block);
					switch (type) {
					case 1:
						animation_out = {
							height : 'hide'
						};
						animation_in = {
							height : 'show'
						};
						break;
					case 2:
						animation_out = {
							opacity : 'hide'
						};
						animation_in = {
							opacity : 'show'
						};
						break;
					case 3:
						animation_out = {
							height : 'hide',
							opacity : 'hide'
						};
						animation_in = {
							height : 'show',
							opacity : 'show'
						};
						break;
					default:
						'';
					}
					firstNode.eq(0).animate(
							animation_out,
							1000,
							function() {
								$(this).clone().appendTo($(this).parent()).css(
										'display', 'none');
								firstNode.eq(eq).removeAttr('style').animate(
										animation_in, 1000);
								$(this).remove();
							});
				}
			</script>
		</c:if>
	</table>
</div>